<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<script type="text/javascript">
	 /*
	 立即执行函数的使用场景：避免全局变量之间的污染
	 */
	// 第一种写法:
	(function() {
		let num=20
		console.log(num)
	})();

	(function(){
		let num=20
		console.log(num)
	})();

	(function(a){
     	let num=20
		console.log(num)
		console.log(a)
	}(10));

	// 第二种写法:
	(function(){
		let num=100
		console.log(num)
	}())
</script>
</body>
</html>